---
title: Code ⇄ enum translation
summary: Translates policy domain codes to and from strongly-typed enums.
status: draft
owner: SAIF Documentation Generator
last_reviewed: 2026-08-21
library: SAIF.Business.Policy
reference_type: package
operation_id: op-14-code-enum-translation
trigger: Any Enums.Convert* call
---

# Code ⇄ enum translation

Translates policy domain codes to/from strongly-typed enum values with no data access or side effects.

| Field | Value |
| --- | --- |
| **Operation ID** | op-14-code-enum-translation |
| **Trigger** | Any `Enums.Convert*` call |
| **Inputs** | Code string or enum member |
| **Outputs** | Enum member or code string |
| **Primary components** | The eleven `Enums.Convert*` overload pairs |
| **Entry point** | SAIF.Business.Policy/Enums.vb |

## Steps

1. A single `Select Case` in each direction over private/public code constants.
2. Unmatched input returns the enum's `Unknown`/`Unassigned` member, or `""` in the enum→code direction ([BR-POL-017](../business-rules.md#br-pol-017-code-enum-conversion-fallback)).
3. No data access, no side effects.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start(["Caller invokes<br>Enums.Convert*"]) --> A{"Direction?"}
	A -->|Code to enum| B["Select Case over<br>code constants"]
	A -->|Enum to code| C["Select Case over<br>enum members"]
	B --> D{"Code matched?"}
	D -->|Yes| E(["Return matching<br>enum member"])
	D -->|No| F(["Return Unknown/<br>Unassigned member"])
	C --> G{"Enum matched?"}
	G -->|Yes| H(["Return matching<br>code string"])
	G -->|No| I(["Return empty string"])
```

## Failure and edge-case behavior
- Unmatched input returns the enum's `Unknown`/`Unassigned` member, or `""` in the enum→code direction ([BR-POL-017](../business-rules.md#br-pol-017-code-enum-conversion-fallback)).

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [SQL catalog](../sql/index.md)
- [Database tables](../database-tables.md)

## Sources
- `SAIF.Business.Policy/Enums.vb`
